package com.polaris.live.dialog

import android.content.Context
import com.lxj.xpopup.core.CenterPopupView
import com.polaris.live.R
import com.polaris.live.common.constant.AppConst
import com.polaris.live.common.constant.CommonConst
import com.polaris.live.common.ext.setOnSingleClickListener
import com.polaris.live.databinding.DialogChargeFailureBinding
import com.polaris.live.utils.image.ImageUtils
import com.polaris.live.utils.route.RouterUtils

/**
 * 充值失败弹窗
 *
 * @author Created by 长空 on 2023/12/04/016 10:50
 */
class ChargeFailureDialog(
    context: Context
) : CenterPopupView(context) {

    override fun getImplLayoutId(): Int {
        return R.layout.dialog_charge_failure
    }

    private lateinit var mBinding: DialogChargeFailureBinding

    override fun onCreate() {
        super.onCreate()
        mBinding = DialogChargeFailureBinding.bind(popupImplView)
        mBinding.ivDelete.setOnSingleClickListener {
            dismiss()
        }
        mBinding.tvConfirm.setOnSingleClickListener {
            RouterUtils.routerWeb(
                ImageUtils.imgPath(AppConst.Customer.suffix),
                mapOf("type" to "${CommonConst.FAQType.RECHARGE}")
            )
            dismiss()
        }
    }
}